﻿<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">

		<title>西安奥德石油工程技术有限责任公司</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<link rel="shortcut icon" href="image/favicons.ico" type="image/x-icon" />
		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		<link rel="stylesheet" href=" css/index.css">
		<link rel="stylesheet" href=" css/top.css">
		<link rel="stylesheet"
			href=" framework/bootstrap-3.0.0/css/bootstrap.css">
		<link rel="stylesheet"
			href=" framework/bootstrap-3.0.0/css/bootstrap.min.css">
		<link rel="stylesheet" type="text/css"
			href="<%=basePath%>common/front/style/bootstrap.min.css">
		<link rel="stylesheet" type="text/css"
			href="<%=basePath%>common/front/style/custom.css">
		<link rel="stylesheet" type="text/css"
			href="<%=basePath%>common/front/style/style.css">
		<script src="<%=basePath%>common/front/js/jquery-1.11.3.min.js"></script>
		<script src="<%=basePath%>common/front/js/bootstrap.min.js"></script>
		<link rel="stylesheet"
			href=" framework/bootstrap-3.0.0/css/bootstrap-theme.css">
		<link href=" framework/bootstrap-3.0.0/css/bootstrap-combined.min.css"
			rel="stylesheet">
		<script type="text/javascript" src=" js/jquery.js"></script>
		<style type="text/css">
a {
	text-decoration: none;
	color: black !important;
}

a:hover {
	text-decoration: none;
	color: #da2b0c !important;
}
</style>
		<script type="text/javascript">
		$(document).ready(function(){
			var show_per_page = 8; 
			var number_of_items = $('#content').children().size();
			var number_of_pages = Math.ceil(number_of_items/show_per_page);
			$('#current_page').val(0);
			$('#show_per_page').val(show_per_page);
			var navigation_html = '<br><br><center><a class="previous_link" href="javascript:previous();">上一页</a>';
			var current_link = 0;
			while(number_of_pages > current_link){
				navigation_html += '<a class="page_link" href="javascript:go_to_page(' + current_link +')" longdesc="' + current_link +'">'+ (current_link + 1) +'</a>';
				current_link++;
			}
			navigation_html += '<a class="next_link" href="javascript:next();">下一页</a></center>';
			$('#page_navigation').html(navigation_html);
			$('#page_navigation .page_link:first').addClass('active_page');
			$('#content').children().css('display', 'none');
			$('#content').children().slice(0, show_per_page).css('display', 'block');	
		});
		function previous(){
			new_page = parseInt($('#current_page').val()) - 1;
			if($('.active_page').prev('.page_link').length==true){
				go_to_page(new_page);
			}
		}
		function next(){
			new_page = parseInt($('#current_page').val()) + 1;
			//if there is an item after the current active link run the function
			if($('.active_page').next('.page_link').length==true){
				go_to_page(new_page);
			}
		}
		function go_to_page(page_num){
			var show_per_page = parseInt($('#show_per_page').val());
			start_from = page_num * show_per_page;
			end_on = start_from + show_per_page;
			$('#content').children().css('display', 'none').slice(start_from, end_on).css('display', 'block');
			$('.page_link[longdesc=' + page_num +']').addClass('active_page').siblings('.active_page').removeClass('active_page');
			$('#current_page').val(page_num);
		}
		</script>
		<style>
#page_navigation a {
	padding: 3px;
	border: 1px solid gray;
	margin: 2px;
	color: black;
	text-decoration: none
}

.active_page {
	background: darkblue;
	color: white !important;
}
</style>
	</head>

	<body style="background-color: #eeeeee; font-family: Microsoft YaHei;">
		<div style="top: 0px;"><jsp:include page="top.jsp"></jsp:include></div>
		<div>
			<img src="images/13.png" width="100%" />
		</div>
		<div style="margin-left: 12%;">
			<a href="front/index"> 首页</a> >
			<a href="front/xinwen">企业新闻</a>
			<br>
			<br>
		</div>
		<div class="show" style="margin-bottom: 5%;">
			<div class="col-md-12">
			<br><br>
				<div style="text-align: center; font-size: 24px;">
					企业新闻
				</div>
				<br />
				<div style="text-align: center; font-size: 18px;">
					ENTERPRISE NEWS
				</div>
				<br />
				<div class="row" style="padding: 15px;">
					<input type='hidden' id='current_page' />
					<input type='hidden' id='show_per_page' />
					<div id='content'>
						<c:forEach items="${one}" var="tema">
							<li class="col-md-3"
								style="margin-top: 20px; list-style-type: none; text-align: center;">
								<a href="front/xwinfo?id=${tema.id }"> <img
										src="${tema.imgurl }" style="height: 150px; width: 200px;" />
								</a>
								<br>
								<div style="display: inline-block;">
									<a href="front/xwinfo?id=${tema.id }"> ${tema.title }</a>
								</div>
								<div style="display: inline-block;">
									${tema.time }
								</div>
							</li>
						</c:forEach>

					</div>
					<table id='page_navigation' width="100%"><tr><td></tr></td></table>
				</div>
			</div>
		</div>
		<div class="footer"><jsp:include page="bottom.jsp" flush="true"></jsp:include></div>
	</body>
</html>
